<template>
  <!-- <lb-table
    ref="lbTable"
    border
    highlight-current-row
    element-loading-text="加载中"
    :column="tableData.column"
    :data="tableData.data"
    :pagination="false"
  /> -->
  <div>
    <div class="cardBox_phone" style="display: flex;">
      <el-card class="box-card" style="width: 40%; margin-right: 10px;">
        <div slot="header" style="display: flex;" class="clearfix">
          <span style="width: 35%;">联系人</span>
          <span style="width: 35%;">电话</span>
        </div>
        <div style=" height: 110px; max-height: 110px; overflow: auto;">
          <div ref="selectPhone">
            <span v-for="(l,i) in csmInfo.phoneItems" :key="i" style="display: flex;" class="text item">
              <span style="width: 35%;">{{ l.contact }}</span>
              <span style="width: 30%;">{{ l.csmPhone }}</span>
              <span style="width: 35%;">{{ `[${cpStatusFormat(l)}]${l.isMain?'[默认]':''} ` }}</span>
            </span>
            <!-- <el-button style="border:0;color:red" circle icon="el-icon-close" /> -->
          </div>
        </div>
      </el-card>
      <el-card class="box-card border" style="width: 60%;">
        <div slot="header" style="display: flex;" class="clearfix">
          <span style="width: 60%;">地址</span>
          <span style="width: 20%;">就近门市</span>
          <span style="width: 10%;">楼层</span>
          <span style="width: 10%;" />
        </div>
        <div style="  height: 110px; max-height: 110px; overflow: auto;">
          <ul ref="selectAddress">
            <li v-for="(l,i) in csmInfo.addressItems" :key="i" class="text item">
              <span class="moduletitle" :title="`${l.provinceName||''}${l.countryName||''}${l.cityName||''}${l.streetName||''}${l.csmAddress||''}`" style="width: 60%;">{{ `${l.provinceName||''}${l.countryName||''}${l.cityName||''}${l.streetName||''}${l.csmAddress||''}` }}</span>
              <span style="width: 20%;">{{ l.orgName }}</span>
              <span style="width: 10%; text-indent: 0.5em;">{{ l.csmFloor||'1' }}</span>
              <span style="width: 10%;">{{ `${l.isMain?'[默认]':''}` }}</span>
            </li>
          </ul>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script>

  export default {
    name: 'tab-user',
    props: {
      csmInfo: {
        type: Object,
        default: {}
      }
    },
    data() {
      return {

      }
    },
    methods: {
      cpStatusFormat(row) {
        if (row.cpStatus === -1) {
          return '已注销'
        } else if (row.cpStatus === 2) {
          return '使用中'
        } else if (row.cpStatus === -2) {
          return '已注销'
        }
      }
    }
  }
</script>

<style lang="scss" scoped>
.cardBox_phone {

  /deep/ .el-card__body {
    // padding:5px 10px;
    padding: 0 10px;
  }
  /deep/ .el-card__header {
    height: 24px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: bold;
    // padding: 0;
    line-height: 24px;
    color: #373A3C;
    background: #e3e3e3;
    border: 1px solid #ddd;
    box-sizing: border-box;
  }
  .text {
    display: flex;
    // border: 1px solid #dddddd;
    // border-top: 0px solid #dddddd;
    justify-content: space-between;
    height: 27px;
    font-size: 14px;
    line-height: 27px;
    color: #373A3C;
    // text-indent: 1em;
  }
  .moduletitle {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
</style>
